package com.seek.service.imp;

import com.seek.core.BaseServiceImpl;
import com.seek.dao.CustomerMetricDao;
import com.seek.model.entity.TCustomerMetric;
import com.seek.service.CustomerMetricService;
import java.util.List;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

/**
 * Created by weh on 2017/7/4.
 */
@Repository("customerMetricService")
public class CustomerMetricServiceImpl extends BaseServiceImpl<TCustomerMetric> implements
    CustomerMetricService {
  @Autowired
  public void setDao(CustomerMetricDao customerMetricDao) {
    super.setDao(customerMetricDao);
  }
  public CustomerMetricDao getDao() {
    return (CustomerMetricDao) super.getDao();
  }
  @Override
  public void saveBatch(List<TCustomerMetric> datas) throws Exception {
    if (CollectionUtils.isEmpty(datas)) {
      return;
    }
    for (TCustomerMetric en : datas) {
      this.getDao().insert(en);
    }
  }
}
